<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">	
	<xsl:include href="controles.xsl" />
	<xsl:include href="secciones.xsl" />
	<xsl:include href="partes-detalle.xsl" />

	<xsl:template match='/'>
		<html>
		<head>
			<link href="estilo/impresion.css" rel="stylesheet" type="text/css"></link>
			<title>Detalle de <xsl:value-of select="//@Titulo" /></title>
			<script language="javascript1.2" src="../Interfaz/Scripts/busca-combo.js"></script>
		</head>
			<body>
				<xsl:call-template name="logo" />
				<xsl:call-template name="membrete" />
				<hr />
				<xsl:apply-templates />
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="Consulta" name="consultas">
		<div id="contenido" align="center">
		
		<div id="titulo"><h3 align="center">Detalle de <xsl:value-of select="//@Titulo"></xsl:value-of></h3></div>
		<xsl:for-each select="Fila">
			<form>
			<xsl:attribute name="name"><xsl:value-of select="//Consulta/@op"/></xsl:attribute>
			<xsl:attribute name="action"><xsl:value-of select="//Consulta/@url"/></xsl:attribute>
			<xsl:attribute name="method">POST</xsl:attribute>
			
			<table class="tabla-contenido" border="1">
				<xsl:for-each select="Columna">
					<xsl:if test="//Estructura/Campo[@Id=current()/@Id]/@Oculto-Detalle='0'">
					<tr class="fila-contenido">
						<td>
							<xsl:choose>
								<xsl:when test="string-length(//Estructura/Campo[@Id=current()/@Id]/@Alias)>0">
									<xsl:value-of select='//Estructura/Campo[@Id=current()/@Id]/@Alias' />
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select='//Estructura/Campo[@Id=current()/@Id]/@Nombre' />
								</xsl:otherwise>
							</xsl:choose>
						</td>
						<td valign="bottom">
									<input>
										<xsl:attribute name="value"><xsl:value-of select="Valor" /></xsl:attribute>
										<xsl:attribute name="name"><xsl:value-of select="@Id" /></xsl:attribute>
										<xsl:attribute name="id"><xsl:value-of select="@Id" /></xsl:attribute>
										<xsl:attribute name="type">text</xsl:attribute>
										<xsl:if test="//Estructura/Campo[@Id=current()/@Id]/@Encriptado='1'">
											<xsl:attribute name="type">password</xsl:attribute>
											<xsl:attribute name="disabled">disabled</xsl:attribute>
											<xsl:attribute name="value"></xsl:attribute>
										</xsl:if>
									</input>
						</td>
					</tr>
					</xsl:if>
				</xsl:for-each>
			</table>
			</form>
		</xsl:for-each>
		</div>
	</xsl:template>
		
</xsl:stylesheet>